import request from "/@/utils/request";
import type { BookingListParams, BookingListItem } from "./types";

// 扎帐添加列表
export function getBookingList(params: BookingListParams) {
  return request<BookingListItem[]>({
    url: "/admin/transportBookkeeping/confirmBookkeepingPage",
    method: "get",
    params,
  });
}

// 扎帐详情
export function kuponoDetail(data: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/kuponoDetail",
    method: "post",
    data,
  });
}

// 扎帐添加
export function addBookkeeping(data: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/addBookkeeping",
    method: "post",
    data,
  });
}

// 取消扎帐
export function cancelBooking(params: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/cancelBookkeeping",
    method: "get",
    params,
  });
}

// 扎帐列表
export function getPageBookingList(params: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/page",
    method: "get",
    params,
  });
}

// 统计
export function getPageBookingListStat(params: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/stat",
    method: "get",
    params,
  });
}

// 获取扎帐详情的联单列表
export function getBookingOrderList(params: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/orderList",
    method: "get",
    params,
  });
}
// 结算中心-下载
export function settlementExport(data: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/settlementExport",
    method: "post",
    data,
  });
}

//结算中心-历史下载列表
export function getSettlementPage(params: any) {
  return request<any>({
    url: "/admin/transportBookkeeping/settlement/page",
    method: "get",
    params,
  });
}

// 获取项目点位列表
export const getPointList1Api = () => {
  return request({
    url: "/admin/projectInfo/listAll",
    method: "get",
  });
};

export const getPointList2Api = () => {
  return request({
    url: "/admin/terminalPoint/listAll",
    method: "get",
  });
};
